package br.inatel.wiiproject.main;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

import br.inatel.wiiproject.data.Coordinate;
import br.inatel.wiiproject.data.Data;
import br.inatel.wiiproject.data.StoredData;

import sun.awt.image.SunWritableRaster.DataStealer;

public class FileReader {

	public FileReader() {
		try {
			FileInputStream isTwo = new FileInputStream("wiiproject_data.txt");
			ObjectInputStream dsTwo;
			dsTwo = new ObjectInputStream(isTwo);
			Data d = (Data) dsTwo.readObject();
			for (int i=0; i< d.getCoordinates().size(); i++){
				Coordinate c = (Coordinate) d.getCoordinates().get(i);
				System.out.println("X: " + c.getX() + " | Y: " + c.getY() + " | ID: " + c.getID());
			}
			isTwo.close();
		} catch (FileNotFoundException e2) {
			e2.printStackTrace();
		} catch (IOException e1) {
			e1.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new FileReader();
	}

}
